package com.shell.provider;

import com.shell.governor.modules.po.PubDictionary;
import com.shell.governor.modules.service.PubDictionaryService;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class PubDictionaryProvider {
	@Autowired
	private PubDictionaryService pubDictionaryService;

	@RequestMapping({ "/dictionary/getAllDicTreeList" })
	public List<PubDictionary> getAllDicTreeList() {
		return this.pubDictionaryService.getAllDicTreeList(null);
	}

	@RequestMapping({ "/dictionary/getDictionaryByCode" })
	PubDictionary getDictionaryByCode(@RequestParam("code") String code) {
		return this.pubDictionaryService.getDictionaryByCode(code);
	}

	@RequestMapping({ "/dictionary/selectChildDictByParentCode" })
	public List<PubDictionary> selectChildDictByParentCode(@RequestParam("parentCode") String parentCode) {
		return this.pubDictionaryService.selectChildDictByParentCode(parentCode);
	}
}
